package lab02.test28;

import java.util.InputMismatchException;
import java.util.Scanner;

public class Test {

    public static void s(){

        try {
            Scanner b = new Scanner(System.in);
            System.out.println("请输入一个 double 数据");
            double r = b.nextDouble();
            System.out.println(r);
            System.out.println(3.14 * r * r);
        }catch (InputMismatchException e)
        {
            System.out.println("输入了字符型");
            s();
        }
    }

    public static void main(String[] args) {
        s();
    }
}
